#ifndef PONG_CORE_H
#define PONG_CORE_H

#include "Configuration.h"
#include "InputManager.h"
#include "StateManager.h"

#include <SDL_net.h>

namespace Ogre {
    class Root;
    class RenderWindow;
}

namespace pong {
	///A class representing the very core of the engine
	class Core {
		protected:
			Ogre::Root* ogreRoot;
            Ogre::RenderWindow* renderWin;

			Configuration config;
            InputManager inputMan;
            StateManager stateMan;

            bool running; // Used for halt()
            double updateInterval; // Represents the time (in seconds) since the
                                   // last update

            Uint16 serverPortNum;
            const char* serverHostName;

		public:
			Core(const Ogre::String& configFolder = ".");
			~Core(void);

			// Main run method--actually starts the engine going.
			int run(int, char**);
			// When called, this will cause the game to stop.
            void halt(void);

			// Accessor for the configuration
            inline const Configuration& congiguration(void) const {return config;}
			inline Configuration& configuration(void) {return config;}

			// Renderer accessor
            inline const Ogre::Root* renderer(void) const {return ogreRoot;}
            inline Ogre::Root* renderer(void) {return ogreRoot;}

			// Render window accessor
            inline const Ogre::RenderWindow* renderWindow(void) const {return renderWin;}
            inline Ogre::RenderWindow* renderWindow(void) {return renderWin;}

			// Input Manager accessor
            inline const InputManager& inputManager(void) const {return inputMan;}
            inline InputManager& inputManager(void) {return inputMan;}

			// State manager accessor
            inline const StateManager& stateManager(void) const {return stateMan;}
            inline StateManager& stateManager(void) {return stateMan;}

			// Accessor for the dt since the last physics call
            inline double timeSinceLastUpdate(void) const {return
updateInterval;}

            // Networking-related accessors
            inline const char* serverName(void) const {return serverHostName;}
            inline Uint16 serverPort(void) const {return serverPortNum;}
	};
}
#endif
